<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    function checkCashRegister(price, cash, cid) {
        var change;
        var a = 0;
        var b = [];
        var e = cash - price;
        var d = [0.01, 0.05, 0.10, 0.25, 1, 5, 10, 20, 100];
        for (var i in cid) {
            a += cid[i][1];
        }
        if ((cash - price) > a) {
            return 'Insufficient Funds';
        } else if ((cash - price) === a) {
            return 'Closed';
        }
        for (var i = d.length - 1; i >= 0; i--) {
            if (i === 0 && e <= cid[i][1]) {
                b.push([cid[i][0], Math.round(e * 100) / 100]);
                e = 0;
            } else if (e >= d[i] && e <= cid[i][1] && cid[i][1] > 0) {
                b.push([cid[i][0], Math.floor(e / d[i]) * d[i]]);
                e = e - Math.floor(e / d[i]) * d[i];
            } else if (e >= d[i] && e >= cid[i][1] && cid[i][1] > 0) {
                b.push(cid[i]);
                e = e - cid[i][1];
            }
            if (e === 0) {
                break;
            }
        }
        if (e !== 0) {
            return 'Insufficient Funds';
        }

        return b;
    }


    convert(36);
</script>
</body>
</html>